import QtQuick 2.0
import QtCharts 2.3
import Qt.Data 1.0;
Item {
    anchors.fill: parent
    ChartView{
        title: "wave"
        anchors.fill: parent
        legend.alignment: Qt.AlignBottom
        antialiasing: true
        SplineSeries{
            id:series
            name: "SplineSeries"
//            XYPoint { x: 0; y: 0.0 }
//            XYPoint { x: 1.1; y: 3.2 }
//            XYPoint { x: 1.9; y: 2.4 }
//            XYPoint { x: 2.1; y: 2.1 }
//            XYPoint { x: 2.9; y: 2.6 }
//            XYPoint { x: 3.4; y: 2.3 }
//            XYPoint { x: 4.1; y: 3.1 }
//            XYPoint { x: 4.9; y: 3.5 }
        }
        Component.onCompleted: {
            //DataSource.setSeries(chartsview.series(0));
            for(var i = 0;i < Datas.count();i ++) {
                            series.append(Datas.getX(i), Datas.getY(i));
                        }
        }
    }
}
